#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>


int main()
{
	int a = 0;
	int arr[10] = { 0 };
	int count = 0;
	scanf("%d", &a);
	for (int i = 0; i < a; i++)
	{
		scanf("%d", &arr[i]);
	}

	int max = arr[0];
	for (int j = 0; j < a; j++)
	{
		if (arr[j] > max)
		{
			count = j;
			max = arr[j];
		}
	}

	printf("%d %d", max, count);


	 return 0;
}